export const tableOption = {
  border: true, //是否带有纵向边框
  selection: true, //行最前面的选择框
  menuAlign: "center",
  // labelWidth: 110,//设置列名称长度
  // searchLabelWidth: 110,//搜索按钮是否单独成行，并控制搜索按钮的长度
  searchIndex: 4, //筛选收缩
  searchIcon: true,
  align: "center", //对齐方式
  emptyText: '自定义暂无数据提示语',
  column: [
    {
      label: "ID",
      prop: "spuId",
      type: "input",
      hide: true,
      editDisabled: true,
      editDisplay: false,
      addDisplay: false,
      span: 12
    },
    {
      label: "品牌",
      prop: "brandId",
      type: "select",
      props: {
        label: 'name',
        value: 'brandId'
      },
      formatter: (val, value, label) => {
        return `${label}(${value})`
      },
      dicUrl: `/admin/product/brand/list`,
      search: true,
      span: 12
    },
    {
      label: "分类",
      prop: "categoryId",
      type: 'cascader',
      props: {
        label: 'name',
        value: 'id'
      },
      dicUrl: `/admin/product/category/tree?name=`,
      showAllLevels: false,//只显示最后层级
      emitPath: false,// 只返回该节点的值
      search: true,
    },
    {
      label: "店铺",
      prop: "shopId",
      type: "select",
      props: {
        label: 'shopName',
        value: 'shopId'
      },
      formatter: (val, value, label) => {
        return `${label}(${value})`
      },
      dicUrl: `/admin/product/shopDetail/list`,
      search: true,
      span: 12
    },
    {
      label: "商品名称",
      prop: "name",
      type: "input",
      search: true,
      span: 12
    },
    {
      label: "卖点",
      prop: "sellingPoint",
      type: "input",
      span: 12
    },
    {
      label: "主图",
      prop: "mainImgUrl",
      type: "upload",
      listType: 'picture-img',
      dataType: 'string',
      tip: '只能上传jpg/png文件,且不超过500kb',
      action: '/admin/sys-file/upload',
      propsHttp: {
        res: 'data'
      },
    },
    {
      label: "轮播图",
      prop: "imgUrls",
      type: "upload",
      listType: 'picture-card',
      dataType: 'string',
      tip: '只能上传jpg/png文件,且不超过500kb',
      action: '/admin/sys-file/upload',
      propsHttp: {
        res: 'data'
      },
      span: 24,
    },
    {
      label: "商品视频",
      prop: "video",
      type: "upload",
      loadText: '视频上传中，请稍等',
      span: 24,
      dataType: 'string',
      tip: '请上传视频文件',
      action: '/admin/sys-file/upload',
      propsHttp: {
        res: 'data'
      },
      showColumn: false,
      limit: 1
    },
    {
      label: "售价",
      prop: "priceFee",
      type: "input",
      span: 12
    },
    {
      label: "市场价",
      prop: "marketPriceFee",
      type: "input",
      span: 12
    },
    {
      label: "状态",
      prop: "status",
      type: "switch",
      dicData: [{
        label: '下架',
        value: false
      }, {
        label: '上架',
        value: true
      }],
      search: true,
      value: 1,
      span: 24
    },
    {
      label: "商品详情",
      prop: "detail",
      component: "AvueUeditor",
      options: {
        action: "/admin/sys-file/upload",
        props: {
          res: "data",
          url: "url",
        },
      },
      hide: true,
      addDisplay: true,
      span: 24
    },
    {
      label: "排序",
      prop: "sortOrder",
      type: "input",
      span: 24
    },
    {
      label: "创建人",
      prop: "createBy",
      type: "input",
      editDisabled: true,
      editDisplay: false,
      addDisplay: false,
    },
    {
      label: "创建时间",
      prop: "createTime",
      type: "datetime",
      dateDefault: true,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      editDisabled: true,
      editDisplay: false,
      addDisplay: false,
    },
  ]
}
